package sample.nacos.client.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumerController {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/test2Consumer")
    public String test2(){
        String result = restTemplate
                .getForObject("http://nacos-provider/test1Provider",
                        String.class);
        return "the provider say: " + result ;
    }
}
